index.html.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- 导航栏 -->
  5. <HomePageNavigation></HomePageNavigation>
  6. <!-- 面包屑导航 -->
  7. <div class="breadcrumb">
  8. <div class="inner">
  9. <span class="location">您的位置:</span>
  10. <el-breadcrumb :separator-icon="ArrowRight">
  11. <el-breadcrumb-item>
  12. <NuxtLink to="/">首页</NuxtLink>
  13. </el-breadcrumb-item>
  14. <el-breadcrumb-item>
  15. {{ newsDetail.con_title }}
  16. </el-breadcrumb-item>
  17. </el-breadcrumb>
  18. </div>
  19. </div>
  20. <!-- 资讯列表 -->
  21. <div class="newsDetail">
  22. <div class="inner">
  23. <div class="innerLeft">
  24. <div class="leftBottomImg" v-if="newsDetail.con_title == '会员服务'">
  25. <img src="../../../public/index/hyfw.jpg" alt="">
  26. </div>
  27. <div class="leftBottomImg" v-if="newsDetail.con_title == '联系我们'">
  28. <img src="../../../public/index/lxwm.jpg" alt="">
  29. </div>
  30. <div class="leftBottomImg" v-if="newsDetail.con_title == '法制项目简介'">
  31. <img src="../../../public/index/xmwzjj.png" alt="">
  32. </div>
  33. <div class="leftBottomImg" v-if="newsDetail.con_title == '免责声明'">
  34. <img src="../../../public/index/mzsm.png" alt="">
  35. </div>
  36. <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
  37. </div>
  38. <div class="innerRight">
  39. <ul>
  40. <li v-for="(item, index) in bottomMenu" :key="index">
  41. <NuxtLink v-if="item.type == 0" :to="`/about/${item.name_pinyin}/index.html`" :title="item.name"
  42. :class="item.id == pageId ? 'active' : ''">
  43. {{ item.name }}
  44. </NuxtLink>
  45. <NuxtLink v-else-if="item.type == 1" :to="`/about/${item.name_pinyin}/list-1.html`"
  46. :title="item.name" :class="item.id == pageId ? 'active' : ''">
  47. {{ item.name }}
  48. </NuxtLink>
  49. </li>
  50. </ul>
  51. </div>
  52. <div style="clear: both;"></div>
  53. </div>
  54. </div>
  55. <!-- 页面底部 -->
  56. <HomeFoot></HomeFoot>
  57. </template>
  58. <script setup>
  59. //1.页面依赖 start ---------------------------------------->
  60. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  61. import { ArrowRight } from '@element-plus/icons-vue'
  62. import { ref, onMounted } from 'vue';
  63. //获得跳转过来的id
  64. const route = useRoute();
  65. //获得当前的完整路径
  66. const fullPath = route.path;
  67. //拆分,取出来中间这一段,然后提取数字部分
  68. const segments = fullPath.split('/');
  69. const targetSegment = segments[2];
  70. //const numberPart = targetSegment.match(/\d+$/)?.[0];
  71. let articleId;
  72. let pageId;
  73. //通过导航路径反向查询导航id
  74. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  75. method: 'GET',
  76. query: {
  77. 'foot_pinyin': targetSegment,
  78. },
  79. });
  80. if (getRouteId.code == 200) {
  81. articleId = getRouteId.data.id;
  82. pageId = getRouteId.data.id;
  83. } else {
  84. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  85. // console.log("错误位置:通过url路径查询导航池id")
  86. // console.log("后端错误反馈:",getRouteId.message)
  87. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  88. }
  89. //1.页面依赖 end ---------------------------------------->
  90. //2.页面数据 start ---------------------------------------->
  91. //广告列表
  92. const adList = ref([]);
  93. let adImg1 = ref([]);
  94. let adImg2 = ref([]);
  95. async function getAdData() {
  96. const adData = await requestDataPromise('/web/getWebsiteAdvertisement', { method: 'GET', query: { 'ad_tag': 'PAGE' } });
  97. adList.value = adData.data;
  98. if (adData.code == 200) {
  99. for (let item of adData.data) {
  100. if (item.ad_tag == 'PAGE_0001') {
  101. adImg1.value = item;
  102. }
  103. if (item.ad_tag == 'PAGE_0002') {
  104. adImg2.value = item;
  105. }
  106. }
  107. } else {
  108. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  109. console.log("错误位置:获取详情页广告列表")
  110. console.log("后端错误反馈:", adData.message)
  111. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  112. }
  113. }
  114. getAdData();
  115. const newsDetail = ref({})
  116. const bottomMenu = ref([]);
  117. async function getPageData() {
  118. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
  119. method: 'GET',
  120. query: {
  121. 'fcat_id': articleId
  122. },
  123. });
  124. newsDetail.value = mkdata.data;
  125. }
  126. getPageData();
  127. async function getPageMenu() {
  128. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
  129. method: 'GET',
  130. query: {},
  131. });
  132. bottomMenu.value = mkdata.data;
  133. }
  134. getPageMenu();
  135. //2.页面数据 end ---------------------------------------->
  136. //4.设置seo信息 start---------------------------------------->
  137. //4.1 设置seo信息
  138. const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
  139. method: 'GET',
  140. query: {},
  141. });
  142. let seoTitle = setData.data.website_head.title;
  143. let seoDescription = setData.data.website_head.description;
  144. let seoKeywords = setData.data.website_head.keywords;
  145. let seoSuffix = setData.data.website_head.suffix;
  146. let seoName = setData.data.website_head.website_name;
  147. useSeoMeta({
  148. title: seoTitle + "_" + seoSuffix,
  149. meta: [
  150. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  151. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
  152. ]
  153. });
  154. //4.设置seo信息 end---------------------------------------->
  155. onMounted(async () => {
  156. //从客户端获取行政职能部门 加快打开速度
  157. const { $webUrl, $CwebUrl } = useNuxtApp();
  158. //广告1
  159. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0001`
  160. const responseAd1 = await fetch(url, {
  161. headers: {
  162. 'Content-Type': 'application/json',
  163. 'Userurl': $CwebUrl,
  164. 'Origin': $CwebUrl
  165. }
  166. });
  167. const resultAd1 = await responseAd1.json();
  168. adImg1.value = resultAd1.data[0];
  169. //广告2
  170. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0002`
  171. const responseAd2 = await fetch(url2, {
  172. headers: {
  173. 'Content-Type': 'application/json',
  174. 'Userurl': $CwebUrl,
  175. 'Origin': $CwebUrl
  176. }
  177. });
  178. const resultAd2 = await responseAd2.json();
  179. adImg2.value = resultAd2.data[0];
  180. })
  181. </script>
  182. <style lang="less" scoped>
  183. @media screen and (min-width: 1401px) {
  184. //导航条
  185. .breadcrumb {
  186. width: 100%;
  187. .inner {
  188. width: 1200PX;
  189. margin: 10PX auto;
  190. border-bottom: 1PX solid #E5E5E5;
  191. }
  192. .el-breadcrumb::v-deep {
  193. display: inline-block;
  194. vertical-align: -4PX;
  195. }
  196. .el-breadcrumb__inner a::v-deep,
  197. .el-breadcrumb__inner.is-link::v-deep {
  198. color: #666666;
  199. font-weight: 400;
  200. text-decoration: none;
  201. transition: var(--el-transition-color);
  202. }
  203. span {
  204. font-family: "宋体";
  205. font-weight: 400;
  206. font-size: 14PX;
  207. color: #666666;
  208. line-height: 40PX;
  209. text-align: left;
  210. font-style: normal;
  211. text-transform: none;
  212. }
  213. .location {
  214. margin-right: 10PX;
  215. display: inline-block;
  216. height: 40PX;
  217. line-height: 40PX;
  218. font-family: "宋体";
  219. font-weight: 400;
  220. font-size: 14PX;
  221. color: #666666;
  222. vertical-align: 11PX;
  223. }
  224. }
  225. // 资讯列表
  226. .newsDetail {
  227. width: 100%;
  228. margin-bottom: 70PX;
  229. .inner {
  230. width: 1200PX;
  231. font-size: 16PX;
  232. margin: 0 auto;
  233. .innerLeft {
  234. width: 980PX;
  235. float: right;
  236. .LeftTop {
  237. margin-top: 50PX;
  238. >h1 {
  239. line-height: 40PX;
  240. margin-bottom: 30PX;
  241. font-family: Microsoft YaHei, Microsoft YaHei;
  242. font-weight: bold;
  243. font-size: 30PX;
  244. color: #333333;
  245. }
  246. >p {
  247. height: 18PX;
  248. line-height: 18PX;
  249. font-family: Microsoft YaHei, Microsoft YaHei;
  250. font-weight: 400;
  251. font-size: 14PX;
  252. color: #999999;
  253. span {
  254. margin-right: 40PX;
  255. }
  256. }
  257. >img {
  258. width: 680PX;
  259. height: 382PX;
  260. padding: 50PX 0PX 60PX 55PX;
  261. }
  262. }
  263. .leftBottomImg {
  264. width: 760PX;
  265. height: 184PX;
  266. margin: 0 auto;
  267. }
  268. .leftBottom {
  269. width: 92%;
  270. font-size: 20PX;
  271. padding-top: 40PX;
  272. margin: 0 auto;
  273. font-family: "微软雅黑", Microsoft YaHei;
  274. line-height: 36PX;
  275. >h3,
  276. >p {
  277. text-indent: 2em;
  278. width: 790PX;
  279. font-family: "微软雅黑", Microsoft YaHei;
  280. font-size: 20PX;
  281. color: #333333;
  282. line-height: 23PX;
  283. padding-bottom: 30PX;
  284. }
  285. >h3 {
  286. font-weight: 600PX;
  287. }
  288. >p {
  289. font-weight: 400;
  290. }
  291. }
  292. }
  293. .innerRight {
  294. width: 200PX;
  295. margin-top: 20PX;
  296. font-family: "微软雅黑";
  297. ul {
  298. li {
  299. a {
  300. display: block;
  301. height: 50PX;
  302. line-height: 50PX;
  303. color: #000;
  304. background: #f3f3f3;
  305. font-size: 18PX;
  306. text-decoration: none;
  307. padding-left: 35PX;
  308. box-sizing: border-box;
  309. border-bottom: 1PX solid #fff;
  310. }
  311. }
  312. }
  313. .active {
  314. border-left: 0;
  315. background: #3395e4;
  316. color: #fff;
  317. }
  318. }
  319. }
  320. }
  321. }
  322. @media screen and (min-width: 801px) and (max-width: 1400px) {
  323. //导航条
  324. .breadcrumb {
  325. width: 100%;
  326. .inner {
  327. width: 90%;
  328. margin: 10PX auto;
  329. border-bottom: 1PX solid #E5E5E5;
  330. }
  331. .el-breadcrumb::v-deep {
  332. display: inline-block;
  333. vertical-align: -4PX;
  334. }
  335. .el-breadcrumb__inner a::v-deep,
  336. .el-breadcrumb__inner.is-link::v-deep {
  337. color: #666666;
  338. font-weight: 400;
  339. text-decoration: none;
  340. transition: var(--el-transition-color);
  341. }
  342. span {
  343. font-family: "宋体";
  344. font-weight: 400;
  345. font-size: 14PX;
  346. color: #666666;
  347. line-height: 40PX;
  348. text-align: left;
  349. font-style: normal;
  350. text-transform: none;
  351. }
  352. .location {
  353. margin-right: 10PX;
  354. display: inline-block;
  355. height: 40PX;
  356. line-height: 40PX;
  357. font-family: "宋体";
  358. font-weight: 400;
  359. font-size: 14PX;
  360. color: #666666;
  361. vertical-align: 11PX;
  362. }
  363. }
  364. // 资讯列表
  365. .newsDetail {
  366. width: 100%;
  367. margin-bottom: 70PX;
  368. .inner {
  369. width: 90%;
  370. margin: 0 auto;
  371. font-size: 16PX;
  372. .innerLeft {
  373. width: 75%;
  374. float: right;
  375. .LeftTop {
  376. margin-top: 50PX;
  377. >h1 {
  378. line-height: 40PX;
  379. margin-bottom: 30PX;
  380. font-family: Microsoft YaHei, Microsoft YaHei;
  381. font-weight: bold;
  382. font-size: 30PX;
  383. color: #333333;
  384. }
  385. >p {
  386. height: 18PX;
  387. line-height: 18PX;
  388. font-family: Microsoft YaHei, Microsoft YaHei;
  389. font-weight: 400;
  390. font-size: 14PX;
  391. color: #999999;
  392. span {
  393. margin-right: 40PX;
  394. }
  395. }
  396. >img {
  397. width: 680PX;
  398. height: 382PX;
  399. padding: 50PX 0PX 60PX 55PX;
  400. }
  401. }
  402. .leftBottomImg {
  403. width: 100%;
  404. img {
  405. width: 100%;
  406. }
  407. }
  408. .leftBottom {
  409. width: 92%;
  410. font-size: 20PX;
  411. padding-top: 40PX;
  412. margin: 0 auto;
  413. font-family: "微软雅黑", Microsoft YaHei;
  414. line-height: 36PX;
  415. >h3,
  416. >p {
  417. text-indent: 2em;
  418. width: 100%;
  419. font-family: "微软雅黑", Microsoft YaHei;
  420. font-size: 20PX;
  421. color: #333333;
  422. line-height: 23PX;
  423. padding-bottom: 30PX;
  424. }
  425. >h3 {
  426. font-weight: 600;
  427. }
  428. >p {
  429. font-weight: 400;
  430. }
  431. }
  432. }
  433. .innerRight {
  434. width: 20%;
  435. margin-top: 20PX;
  436. margin-right: 20PX;
  437. font-family: "微软雅黑";
  438. ul {
  439. li {
  440. a {
  441. display: block;
  442. height: 50PX;
  443. line-height: 50PX;
  444. color: #000;
  445. background: #f3f3f3;
  446. font-size: 18PX;
  447. text-decoration: none;
  448. padding-left: 35PX;
  449. box-sizing: border-box;
  450. border-bottom: 1PX solid #fff;
  451. }
  452. }
  453. }
  454. .active {
  455. border-left: 0;
  456. background: #3395e4;
  457. color: #fff;
  458. }
  459. }
  460. }
  461. }
  462. }
  463. @media screen and (max-width: 800px) {
  464. //导航条
  465. .breadcrumb {
  466. width: 100%;
  467. .inner {
  468. width: 100%;
  469. padding: 0 20px;
  470. border-bottom: 2px solid #E5E5E5;
  471. }
  472. .el-breadcrumb::v-deep {
  473. display: inline-block;
  474. vertical-align: -4px;
  475. }
  476. .el-breadcrumb__inner a::v-deep,
  477. .el-breadcrumb__inner.is-link::v-deep {
  478. color: #666666;
  479. font-weight: 400;
  480. text-decoration: none;
  481. transition: var(--el-transition-color);
  482. }
  483. span {
  484. font-family: "宋体";
  485. font-weight: 400;
  486. font-size: 28px;
  487. color: #666666;
  488. line-height: 80px;
  489. text-align: left;
  490. font-style: normal;
  491. text-transform: none;
  492. }
  493. .location {
  494. margin-right: 10px;
  495. display: inline-block;
  496. height: 80px;
  497. line-height: 80px;
  498. font-family: "宋体";
  499. font-weight: 400;
  500. font-size: 28px;
  501. color: #666666;
  502. vertical-align: 24px;
  503. }
  504. }
  505. // 资讯列表
  506. .newsDetail {
  507. width: 100%;
  508. margin-bottom: 70px;
  509. .inner {
  510. width: 100%;
  511. font-size: 32px;
  512. .innerLeft {
  513. width: 100%;
  514. margin-top: 20px;
  515. .leftBottomImg {
  516. width: 100%;
  517. text-align: center;
  518. img {
  519. width: 96%;
  520. }
  521. }
  522. .leftBottom {
  523. width: 92%;
  524. font-size: 40px !important;
  525. padding-top: 40px;
  526. margin: 0 auto;
  527. font-family: "微软雅黑", Microsoft YaHei;
  528. line-height: 72px;
  529. h3,
  530. p {
  531. width: 100%;
  532. font-family: "微软雅黑", Microsoft YaHei;
  533. font-size: 40px;
  534. color: #333333;
  535. line-height: 72px;
  536. padding-bottom: 30px;
  537. }
  538. h3 {
  539. font-weight: 600;
  540. }
  541. p {
  542. font-weight: 400;
  543. }
  544. span {
  545. font-size: 40px !important;
  546. }
  547. }
  548. }
  549. .innerRight {
  550. display: none;
  551. width: 200px;
  552. margin-top: 20px;
  553. font-family: "微软雅黑";
  554. ul {
  555. li {
  556. a {
  557. display: block;
  558. height: 50px;
  559. line-height: 50px;
  560. color: #000;
  561. background: #f3f3f3;
  562. font-size: 18px;
  563. text-decoration: none;
  564. padding-left: 35px;
  565. box-sizing: border-box;
  566. border-bottom: 1px solid #fff;
  567. }
  568. }
  569. }
  570. .active {
  571. border-left: 0;
  572. background: #3395e4;
  573. color: #fff;
  574. }
  575. }
  576. }
  577. }
  578. }
  579. </style>